# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=tiny-dfr
pkgver=0.2.0
pkgrel=0
pkgdesc="Apple silicon touch bar input / display daemon"
url="https://github.com/WhatAmISupposedToPutHere/tiny-dfr"
arch="aarch64"
license="MIT"
makedepends="cargo pango-dev libinput-dev gdk-pixbuf-dev libxml2-dev"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/WhatAmISupposedToPutHere/tiny-dfr/archive/refs/tags/v$pkgver.tar.gz
	tiny-dfr.initd"

build() {
	cargo build --release --all-features
}


package() {
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm755 target/release/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 share/$pkgname/*.svg -t "$pkgdir/usr/share/$pkgname"
	install -Dm644 share/$pkgname/config.toml -t "$pkgdir/usr/share/$pkgname"
	install -Dm644 etc/udev/rules.d/99-touchbar-seat.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-seat.rules"
	install -Dm644 etc/udev/rules.d/99-touchbar-tiny-dfr.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-tiny-dfr.rules"
}

sha512sums="
0821eb0f2fd43f9335ef5853c1f6ff387e911395d6cf07a4eecc15ad4d86324a00b5688c780b60d60a19f45d220021770da44a343c638247ad62a19883826ad2  tiny-dfr-0.2.0.tar.gz
02f8ad47061de4048306c3ac49873f36c6768ba6812d244524e366909baf3e96ddc38c0177a9eb03a30132bfa025e007c8a93ee22157bfcea52bded8cffeda3f  tiny-dfr.initd
"
